USE [bisas2]
GO
/****** Object:  Table [dbo].[T_MST_JENIS_DOK]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_JENIS_DOK](
	[id_jenis_dok] [bigint] IDENTITY(1,1) NOT NULL,
	[jenis_dok] [varchar](50) NULL,
	[deskripsi] [varchar](50) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_JENIS_DOK] PRIMARY KEY CLUSTERED 
(
	[id_jenis_dok] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_JENIS_ARSIP]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_JENIS_ARSIP](
	[id_jenis_arsip] [bigint] IDENTITY(1,1) NOT NULL,
	[jenis_arsip] [varchar](12) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_JENIS_ARSIP] PRIMARY KEY CLUSTERED 
(
	[id_jenis_arsip] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_DIVISI]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_DIVISI](
	[id_divisi] [bigint] IDENTITY(1,1) NOT NULL,
	[id_satker] [bigint] NOT NULL,
	[kode_divisi] [varchar](12) NULL,
	[deskripsi] [varchar](150) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_DIVISI] PRIMARY KEY CLUSTERED 
(
	[id_divisi] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_BIDANG_DOK]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_BIDANG_DOK](
	[id_bidang_dok] [bigint] IDENTITY(1,1) NOT NULL,
	[bidang_dok] [varchar](50) NULL,
	[deskripsi] [varchar](50) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_BIDANG_DOK] PRIMARY KEY CLUSTERED 
(
	[id_bidang_dok] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_STATUS]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_STATUS](
	[id_status] [bigint] IDENTITY(1,1) NOT NULL,
	[status] [varchar](12) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_STATUS] PRIMARY KEY CLUSTERED 
(
	[id_status] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_LOKASI]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_LOKASI](
	[id_lokasi] [bigint] IDENTITY(1,1) NOT NULL,
	[kode_lokasi] [varchar](12) NULL,
	[id_divisi] [bigint] NOT NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_LOKASI] PRIMARY KEY CLUSTERED 
(
	[id_lokasi] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_KONTAINER]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_KONTAINER](
	[id_kontainer] [bigint] IDENTITY(1,1) NOT NULL,
	[kode_kontainer] [varchar](12) NULL,
	[id_divisi] [bigint] NOT NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_KONTAINER] PRIMARY KEY CLUSTERED 
(
	[id_kontainer] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[T_MST_KLASIFIKASI]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_KLASIFIKASI](
	[id_klasifikasi] [bigint] IDENTITY(1,1) NOT NULL,
	[kode_klasifikasi] [varchar](8) NOT NULL,
	[deskripsi] [varchar](150) NULL,
	[id_jenis_dok] [bigint] NOT NULL,
	[nilai_guna] [varchar](50) NULL,
	[nomor_se] [varchar](25) NULL,
	[tgl_se] [datetime] NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_KLASIFIKASI] PRIMARY KEY CLUSTERED 
(
	[id_klasifikasi] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[T_MST_SATKER]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_SATKER](
	[id_satker] [bigint] IDENTITY(1,1) NOT NULL,
	[kode_satker] [varchar](12) NOT NULL,
	[nama_satker] [varchar](80) NULL,
	[telp] [varchar](9) NULL,
	[lokasi_satker] [varchar](80) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_SATKER] PRIMARY KEY CLUSTERED 
(
	[id_satker] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

/****** Object:  Table [dbo].[T_SKA_ARSIP]    Script Date: 11/22/2012 17:30:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_SKA_ARSIP](
	[id_arsip] [bigint] IDENTITY(1,1) NOT NULL,
	[id_klasifikasi] [bigint] NOT NULL,
	[id_divisi] [bigint] NULL,
	[perihal] [varchar](150) NULL,
	[keyword] [varchar](150) NULL,
	[tahun] [int] NULL,
	[jangka_retensi] [int] NULL,
	[jumlah_dok] [int] NULL,
	[actual_jumlah_dok] [int] NULL,
	[id_kontainer] [bigint] NULL,
	[id_lokasi] [bigint] NULL,
	[id_status] [bigint] NULL,
	[id_jenis_arsip] [bigint] NULL,
	[tgl_entry] [datetime] NULL,
	[id_pengentry] [bigint] NULL,
	[tgl_validasi] [datetime] NULL,
	[id_validator] [bigint] NULL,
	[is_valid] [bit] NULL,
	[is_relocated] [bit] NULL,
	[is_destroyed] [bit] NULL,
 CONSTRAINT [PK_T_SKA_ARSIP] PRIMARY KEY CLUSTERED 
(
	[id_arsip] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  ForeignKey [FK_T_MST_KLASIFIKASI_T_MST_JENIS_DOK]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_MST_KLASIFIKASI]  WITH CHECK ADD  CONSTRAINT [FK_T_MST_KLASIFIKASI_T_MST_JENIS_DOK] FOREIGN KEY([id_jenis_dok])
REFERENCES [dbo].[T_MST_JENIS_DOK] ([id_jenis_dok])
GO
ALTER TABLE [dbo].[T_MST_KLASIFIKASI] CHECK CONSTRAINT [FK_T_MST_KLASIFIKASI_T_MST_JENIS_DOK]
GO
/****** Object:  ForeignKey [FK_T_MST_KONTAINER_T_MST_DIVISI]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_MST_KONTAINER]  WITH CHECK ADD  CONSTRAINT [FK_T_MST_KONTAINER_T_MST_DIVISI] FOREIGN KEY([id_divisi])
REFERENCES [dbo].[T_MST_DIVISI] ([id_divisi])
GO
ALTER TABLE [dbo].[T_MST_KONTAINER] CHECK CONSTRAINT [FK_T_MST_KONTAINER_T_MST_DIVISI]
GO
/****** Object:  ForeignKey [FK_T_MST_LOKASI_T_MST_DIVISI]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_MST_LOKASI]  WITH CHECK ADD  CONSTRAINT [FK_T_MST_LOKASI_T_MST_DIVISI] FOREIGN KEY([id_divisi])
REFERENCES [dbo].[T_MST_DIVISI] ([id_divisi])
GO
ALTER TABLE [dbo].[T_MST_LOKASI] CHECK CONSTRAINT [FK_T_MST_LOKASI_T_MST_DIVISI]
GO

/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_DIVISI]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_DIVISI] FOREIGN KEY([id_divisi])
REFERENCES [dbo].[T_MST_DIVISI] ([id_divisi])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_DIVISI]
GO
/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_JENIS_ARSIP]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_JENIS_ARSIP] FOREIGN KEY([id_jenis_arsip])
REFERENCES [dbo].[T_MST_JENIS_ARSIP] ([id_jenis_arsip])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_JENIS_ARSIP]
GO
/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_KLASIFIKASI]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_KLASIFIKASI] FOREIGN KEY([id_klasifikasi])
REFERENCES [dbo].[T_MST_KLASIFIKASI] ([id_klasifikasi])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_KLASIFIKASI]
GO
/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_KONTAINER]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_KONTAINER] FOREIGN KEY([id_kontainer])
REFERENCES [dbo].[T_MST_KONTAINER] ([id_kontainer])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_KONTAINER]
GO
/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_LOKASI]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_LOKASI] FOREIGN KEY([id_lokasi])
REFERENCES [dbo].[T_MST_LOKASI] ([id_lokasi])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_LOKASI]
GO

/****** Object:  ForeignKey [FK_T_SKA_ARSIP_T_MST_STATUS]    Script Date: 10/25/2012 14:17:27 ******/
ALTER TABLE [dbo].[T_SKA_ARSIP]  WITH CHECK ADD  CONSTRAINT [FK_T_SKA_ARSIP_T_MST_STATUS] FOREIGN KEY([id_status])
REFERENCES [dbo].[T_MST_STATUS] ([id_status])
GO
ALTER TABLE [dbo].[T_SKA_ARSIP] CHECK CONSTRAINT [FK_T_SKA_ARSIP_T_MST_STATUS]
GO



/****** Object:  Table [dbo].[T_MST_UNIT]    Script Date: 10/25/2012 14:17:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[T_MST_UNIT](
	[id_unit] [bigint] IDENTITY(1,1) NOT NULL,
	[id_divisi] [bigint] NOT NULL,
	[kode_unit] [varchar](12) NULL,
	[deskripsi] [varchar](150) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_UNIT] PRIMARY KEY CLUSTERED 
(
	[id_unit] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO


/****** Object:  Table [dbo].[T_MST_USER]    Script Date: 11/02/2012 13:29:58 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_MST_USER](
	[id_user] [bigint] IDENTITY(1,1) NOT NULL,
	[login_name] [varchar](20) NOT NULL,
	[user_name] [varchar](50) NULL,
	[passwd] [varchar](50) NOT NULL,
	[email] [varchar](50) NULL,
	[grade] [varchar](3) NULL,
	[id_jabatan] [bigint] NULL,
	[id_divisi] [bigint] NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_USER] PRIMARY KEY CLUSTERED 
(
	[id_user] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY]

GO

/****** Object:  Table [dbo].[T_MST_JABATAN]    Script Date: 11/02/2012 13:29:58 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_MST_JABATAN](
	[id_jabatan] [bigint] IDENTITY(1,1) NOT NULL,
	[kode_jabatan] [varchar](12) NOT NULL,
	[deskripsi] [varchar](150) NULL,
	[is_active] [bit] NULL,
	[tgl_update] [datetime] NULL,
 CONSTRAINT [PK_T_MST_JABATAN] PRIMARY KEY CLUSTERED 
(
	[id_jabatan] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY]

GO


/****** Object:  Table [dbo].[T_SKA_SIFAT_DOK]    Script Date: 11/05/2012 14:36:10 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_SKA_SIFAT_DOK](
	[id_sifat_dok] [bigint] IDENTITY(1,1) NOT NULL,
	[sifat_dok] [varchar](50) NULL,
 CONSTRAINT [PK_T_SKA_SIFAT_DOK] PRIMARY KEY CLUSTERED 
(
	[id_sifat_dok] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

INSERT INTO [dbo].[T_SKA_SIFAT_DOK] (sifat_dok) values ('RAHASIA');
INSERT INTO [dbo].[T_SKA_SIFAT_DOK] (sifat_dok) values ('TIDAK RAHASIA');

GO



/****** Object:  Table [dbo].[T_SKA_DOKUMEN]    Script Date: 11/05/2012 11:29:05 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[T_SKA_DOKUMEN](
	[id_dokumen] [bigint] IDENTITY(1,1) NOT NULL,
	[id_arsip] [bigint] NOT NULL,
	[no_dokumen] [varchar](50) NOT NULL,
	[nama_dokumen] [varchar](50) NOT NULL,
	[perihal] [varchar](500) NULL,
	[tanggal] [datetime] NULL,
	[id_jenis_dok] [bigint] NOT NULL,
	[id_divisi] [bigint] NOT NULL,
	[pihak_pengirim] [varchar](100) NULL,
	[pihak_dituju] [varchar](100) NULL,
	[id_bidang_dok] [bigint] NOT NULL,
	[id_sifat_dok] [bigint] NOT NULL,
 CONSTRAINT [PK_T_SKA_DOKUMEN] PRIMARY KEY CLUSTERED 
(
	[id_dokumen] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]







